import numpy as np
from .piece import an, ak, a_s, ax, am, ac, ap, ab

mapper = {tp: {'name': name, 'key': key, 'rule': rule} for tp, name, key, rule in zip(
    [0, 1, 2, 3, 4, 5, 6, 7, -1, -2, -3, -4, -5, -6, -7],
    ['－', '帅', '仕', '相', '码', '車', '砲', '兵', '将', '士', '象', '马', '车', '炮', '卒'],
    ['n', 'K', 'S', 'X', 'M', 'C', 'P', 'B', 'k', 's', 'x', 'm', 'c', 'p', 'b'],
    [an, ak, a_s, ax, am, ac, ap, ab, ak, a_s, ax, am, ac, ap, ab],
)}

default_board_state = np.asarray([
    [-5, -4, -3, -2, -1, -2, -3, -4, -5],
    [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
    [ 0, -6,  0,  0,  0,  0,  0, -6,  0],
    [-7,  0, -7,  0, -7,  0, -7,  0, -7],
    [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
    [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
    [ 7,  0,  7,  0,  7,  0,  7,  0,  7],
    [ 0,  6,  0,  0,  0,  0,  0,  6,  0],
    [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
    [ 5,  4,  3,  2,  1,  2,  3,  4,  5],
], dtype=int)
